// header模块

// state
//  const state = () => ({
//   mame: '雷小天',
//   categories: [],
//   currmenu: 'home',
//   currnum: 0
// })
const state = {
  mame: '雷小天',
  categories: [],
  currmenu: 'home',
  currnum: 0
}
// mutation
 const mutations = {
  setCategories (state, payload) {
    state.name = '全部分类'
    state.categories = payload
  },
  setCurrmenu (state, menu) {
    state.currmenu = menu
  },
  setCurrnum (state, num) {
    state.currnum = num
  }
}

// actions
 const actions = {
  A_UPDATE_CATEGORIES ({ commit, cate }, payload) {
    // 异步业务
    commit('M_UPDATE_CATEGORIES', payload)
  }
}

 const getters = {
  getName (state) {
    return state.name ? '显示' : '隐藏'
  }
}

export default {
  state,
  getters,
  actions,
  mutations
}

